package ppOO;

import java.text.DecimalFormat;

public abstract class General {

   public final static boolean DEBUG = false,
         DETAILED_DEBUG = false;
   public static String printArray(double[][] array) {
      String output = "";
      for (double[] i : array) {
         output += "\n\t\t"
               + printArray(i);
      }
      return output;
   }
   public static String printArray(double[] array) {

      String output = "";
      for (double i : array) {
         output += "\t["
               + fourDP(i) + "]";
      }

      return output;
   }

   public void println(String string) {
      System.out.println(string);
   }
   public static String fourDP(double mathInput) {
      DecimalFormat FourDP;
      if (mathInput > 0) {
         FourDP = new DecimalFormat(" #0.0000");
      } else {
         FourDP = new DecimalFormat("#0.0000");
      }

      String output = FourDP.format(mathInput);
      return output;
   }
   public double derivativeActivationFunction(double output) {
      return 0.5 * (1 - Math.pow(output, 2));
   }
}
